<?php

namespace CHOMP\SGIBundle\Form;

use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\OptionsResolver\OptionsResolverInterface;

class EmpresaType extends AbstractType
{
        /**
     * @param FormBuilderInterface $builder
     * @param array $options
     */
    public function buildForm(FormBuilderInterface $builder, array $options)
    {
        $builder
            ->add('nombre')
            ->add('descripcion') 
            ->add('pais')          
            ->add('provincia')          
            ->add('codigopostal', 'text', array ('label' => 'Codigo Postal'))          
            ->add('calle')
			->add('numero')
			->add('piso')
			->add('dpto')  
            ->add('telefono')
			
			->add('save', 'submit', array ('label' => 'Guardar', 'attr'=> array('class'=>'btn middle-first-of-three')))
            ->add('continuar', 'submit', array ('label' => 'Guardar y Continuar', 'attr'=> array('class'=>'btn middle-second-of-three')))
            ->add('volver', 'submit', array ('label' => 'Volver', 'attr'=> array('class'=>'btn middle-third-of-three')));
    } 
    
    /**
     * @param OptionsResolverInterface $resolver
     */
    public function setDefaultOptions(OptionsResolverInterface $resolver)
    {
        $resolver->setDefaults(array(
            'data_class' => 'CHOMP\SGIBundle\Entity\Empresa'
        ));
    }

    /**
     * @return string
     */
    public function getName()
    {
        return 'chomp_sgibundle_empresa';
    }
}
